<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html>
<head>
    <title>Title</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
</head>
<body class="easyui-layout">
<div data-options="region:'north'" style="height: 50px">
    <a href="/logout.html">退出</a>
</div>
<div data-options="region:'west'" title="菜单" style="width: 10%">
    <ul class="easyui-tree" id="leftMenu">

    </ul>

</div>
<div data-options="region:'center'" title="首页">
    <div id="tabs" class="easyui-tabs"></div>

</div>
<script type="text/javascript">
    $(function () {
        $("#leftMenu").tree({
            url: "<%=request.getContextPath()%>/side.html",
            onClick: function (node) {
                if ($("#leftMenu").tree("isLeaf", node.target)) {
                    var tabs = $("#tabs");
                    var tab = tabs.tabs("getTab", node.text);
                    if (tab) {
                        tabs.tabs("select", node.text)
                    } else {
                        tabs.tabs("add", {
                            title: node.text,
                            href: node.url,
                            closable: true
                        })
                    }
                }
            }
        })
    })
</script>
</body>
</html>
